package gof.observe;

/**
 * TODO
 * 2020-11-03 10:58
 */
public class Display02 implements Observer, DisplayElement{

    Integer Temprature;
    Integer Humidity;
    Integer Pressure;
    WeatherData weatherData;

    public Display02(WeatherData weatherData){
        this.weatherData = weatherData;
        weatherData.registerObserver(this);
    }

    @Override
    public void update(Integer Temprature, Integer Humidity, Integer Pressure) {
        this.Temprature = Temprature;
        this.Humidity = Humidity;
        this.Pressure = Pressure;
        display();
    }

    @Override
    public void display() {
        System.out.println("display 02 :" + this.Temprature + this.Humidity + this.Pressure);
    }

}
